﻿using System;
using System.Web;

namespace Sex
{
    public partial class Sex : System.Web.UI.Page
    {
        public class ListModules : MyList
        {
            public ListModules(State MyState)
                : base(MyState, "Modules")
            {
                HttpContext myHttpContext = HttpContext.Current;
                HttpApplication myHttpApplication = myHttpContext.ApplicationInstance;
                HttpModuleCollection myHttpModuleCollection = myHttpApplication.Modules;
                string[] allModules = myHttpModuleCollection.AllKeys;
                System.Array httpModuleArray = Array.CreateInstance(typeof(object), myHttpModuleCollection.AllKeys.Length);
                myHttpModuleCollection.CopyTo(httpModuleArray, 0);
                for (int i = 0; i < allModules.Length; i++)
                    Add(i.ToString().PadLeft(2, '0'), new string[] { allModules[i].ToString(), httpModuleArray.GetValue(i).ToString() });
            }
        }
    }
}